# 使用raise抛出异常

# name = input("请输入你的名字(10个字以内)")
# try:
#     if len(name)>10:
#         raise NameError
#     else:
#         print(name)
# except Exception as e:
#     print(e)
# print('结束')

# 手动抛出异常 assert语句
name = input("请输入你的名字(10个字以内)")
assert len(name)<10,'名字太长'